﻿<navigation:Page x:Class="XamlPhysics.Samples.SampleMenu" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           mc:Ignorable="d"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="SampleMenu Page">
    
    <Grid x:Name="LayoutRoot">
        <ScrollViewer Width="400" HorizontalAlignment="Center">
            <ItemsControl x:Name="UxSamples" BorderThickness="0" >
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.Resources>
                    <Style x:Key="MainMenuButton" TargetType="ButtonBase">
                        <Setter Property="Cursor" Value="Hand" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate>
                                    <Grid>
                                        <ContentPresenter x:Name="Content" Margin="0,2,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="HorizontalAlignment" Value="Left" />
                    </Style>
                    <Style x:Key="MainMenuText" TargetType="TextBlock">
                        <Setter Property="FontFamily" Value="Verdana" />
                        <Setter Property="FontSize" Value="30" />
                        <Setter Property="HorizontalAlignment" Value="Left" />
                    </Style>
                </ItemsControl.Resources>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <HyperlinkButton Style="{StaticResource MainMenuButton}" NavigateUri="{Binding Path}" TargetName="UxSampleViewer">
                            <TextBlock Style="{StaticResource MainMenuText}" Text="{Binding Path=Name}" />
                        </HyperlinkButton>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</navigation:Page>